var React = require('react');
var ReactDOM = require('react-dom');
import ComponentHeader from './components/header';
import ComponentFooter from './components/footer';
import BodyIndex from './components/indexBody';

class Index extends React.Component {
    render() {
        /*  伪代码
            var component;
            if(用户已登录){
                component = <ComponentFooter/>
            }else{
                component = <ComponentHeader/>
            }
         */

        return (
            <div>
                {/*{component}*/}
                <ComponentHeader/>
                <BodyIndex/>
                <ComponentFooter/>
            </div>
        )
    }
}

ReactDOM.render(
    <Index/>,
    document.getElementById('App')
);